﻿<UserControl x:Class="Microsoft.Research.ScientificWorkflow.UIDesigner.WorkflowMetaPopup"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
             xmlns:UI="clr-namespace:Microsoft.Research.ScientificWorkflow.UIDesigner"
    Height="Auto" Width="Auto">

    <UserControl.Resources>
        <Style x:Key="PopupCloseButton" BasedOn="{x:Null}" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <Rectangle Fill="#FFCCCCCC" Stroke="{x:Null}" RadiusX="4.5" RadiusY="4.5" x:Name="rectangle"/>
                            <Rectangle Fill="#FF4F4F4F" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Margin="8,3.5,7,3.5" RenderTransformOrigin="0.5,0.5">
                                <Rectangle.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="-34.039"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Rectangle.RenderTransform>
                            </Rectangle>
                            <Rectangle Fill="#FF4F4F4F" Stroke="{x:Null}" RadiusX="0" RadiusY="0" RenderTransformOrigin="0.5,0.5" Margin="8,3.5,7,3.5">
                                <Rectangle.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="-1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="34.039"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Rectangle.RenderTransform>
                            </Rectangle>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsFocused" Value="True"/>
                            <Trigger Property="IsDefaulted" Value="True"/>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Fill" TargetName="rectangle" Value="#FFADADAD"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True"/>
                            <Trigger Property="IsEnabled" Value="False"/>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot">
        <Border Name="brdrMain" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="270" BorderBrush="#FFBDBDBD" BorderThickness="1,1,2,2" CornerRadius="4,4,4,4">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFF7F7F7" Offset="0"/>
                    <GradientStop Color="#FFF1F1F1" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="28"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="38"/>
                </Grid.RowDefinitions>
                <Border Name="brdrHeader" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Grid.Row="0" CornerRadius="4,4,0,0">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF7F7F7" Offset="0"/>
                            <GradientStop Color="#FFE9E9E9" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <Grid>
                        <TextBlock HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Center" FontSize="14" Foreground="#FF5F5F5F" Text="Save" TextWrapping="Wrap" Name="txtBlkMainHeader"/>
						<Button HorizontalAlignment="Right" Margin="0,5.5,5,5.5" Style="{DynamicResource PopupCloseButton}" Width="17" Content="Button" Click="OnCloseClick"/>
					</Grid>
                </Border>
                <StackPanel HorizontalAlignment="Stretch" Margin="10,10,5,5" Grid.Row="1">
                    <TextBlock Text="Name:" TextWrapping="Wrap" />
					<TextBox Margin="0,2,5,5" Text="" MaxLength="75" TextWrapping="NoWrap" Name="txtWorkFlowName" MaxLines="1" VerticalScrollBarVisibility="Auto"/>
                    
                    <TextBlock  x:Name="ErrorLabel" Margin="0,-5,5,0" Foreground="Red" Visibility="Collapsed" TextWrapping="Wrap"></TextBlock>
					<TextBlock Text="Description:" TextWrapping="Wrap"/>
					<TextBox Text="" TextWrapping="Wrap" MinLines="4" MaxLines="4" MaxLength="300" Margin="0,2,5,5" Name="txtWorkFlowDescription" VerticalScrollBarVisibility="Auto"/>
			    </StackPanel>
                <Button IsDefault="True" HorizontalAlignment="Right" Width="70" Content="Save" Margin="0,0,85,0" VerticalAlignment="Center" Grid.Row="2" d:LayoutOverrides="Height" Name="btnOk" Click="OnOkClick"/>
                <Button IsCancel="True" HorizontalAlignment="Right" Width="70" Content="Cancel" Margin="0,0,10,0" VerticalAlignment="Center" Grid.Row="2" Name="btnCancel" Click="OnCancelClick" />                
            </Grid>
        </Border>
    </Grid>
</UserControl>
